Skip to content

Conversation

@drifter089
Copy link
Owner

@drifter089 drifter089 commented Jan 9, 2026

Summary

Replace the compact KPI card on the member page with the full dashboard chart card that includes actual chart visualizations. Also removes hover animations from cards on the member page since they are display-only.

Changes

  • Replace KpiCard with ReadOnlyMetricCard on member page for full chart display
  • Remove hover animation from RoleCard when in read-only mode
  • Clean up unused teamId prop from RoleKpiPair component

Summary by CodeRabbit

  • Style
    • Enhanced role card styling with conditional hover effects in non-read-only mode.
    • Adjusted metric card layout spacing and border radius for improved visual presentation.
    • Updated KPI section grid spacing and loading state appearance.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
org-os Ready Ready Preview, Comment Jan 9, 2026 3:56pm

@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

📝 Walkthrough

Walkthrough

This PR removes the teamId dependency from the RoleKpiPair component, replaces KpiCard with ReadOnlyMetricCard, and makes the hover shadow effect in RoleCard conditional based on the readOnly state. Minor layout adjustments are also applied to the KPI loading placeholder.

Changes

Cohort / File(s) Summary
KPI Component Refactoring
src/app/member/[id]/_components/role-kpi-pair.tsx, src/app/member/[id]/_components/team-section.tsx
Removed teamId prop from RoleKpiPair interface and component signature. Replaced KpiCard usage with ReadOnlyMetricCard. Updated grid gap (3→4), adjusted KPI loading placeholder height to h-[420px], and changed border radius from rounded-lg to rounded-xl.
Role Card Styling
src/components/role/role-card.tsx
Made hover shadow effect conditional—hover:shadow-lg now only applies when readOnly is false.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A card once held a teamId's name,
Now freed, it hops with ReadOnly fame,
The shadows dance when readOnly's slight,
Rounded corners gleam so bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: replacing KpiCard with ReadOnlyMetricCard (full chart card) on the member page, which is the primary objective of the pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Contributor

claude bot commented Jan 9, 2026

Pull Request Review

Summary

This PR successfully replaces the compact KpiCard component with the full ReadOnlyMetricCard on the member page, providing richer chart visualizations. The changes are clean and well-focused.


✅ Positive Aspects

  1. Clean component consolidation: Removing unused teamId prop and simplifying the component interface is excellent cleanup.

  2. Improved UX consistency: Using the same ReadOnlyMetricCard that appears elsewhere in the app provides a more consistent user experience.

  3. Proper use of existing components: Leveraging the already-defined ReadOnlyMetricCard avoids code duplication.

  4. Appropriate read-only mode: Disabling hover animations on read-only role cards makes sense for display-only contexts.

  5. Visual consistency improvements:

    • Gap increased from gap-3 to gap-4 for better spacing
    • Placeholder state now uses h-[420px] and rounded-xl to match the actual metric card dimensions

🔍 Areas for Consideration

1. Height Consistency Issue (Medium Priority)

The placeholder "KPI data loading..." state now has a hardcoded height (h-[420px]), but the actual ReadOnlyMetricCard doesn't have a fixed height constraint. This could lead to layout shifts:

// Current placeholder
<div className="... flex h-[420px] items-center justify-center ...">

// But ReadOnlyMetricCard has no height constraint
<div className="relative">
  <DashboardMetricChart ... />

Suggestion: Consider either:

  • Adding a minimum height to ReadOnlyMetricCard wrapper
  • Using min-h-[420px] instead of h-[420px] on placeholder
  • Or verify if the chart component naturally maintains consistent height

2. Missing Error Handling Context (Low Priority)

The ReadOnlyMetricCard shows error badges based on metric.lastError and metric.refreshStatus, but these fields might not be populated in the member page context since it uses role.getByUser router. Worth verifying:

// In ReadOnlyMetricCard
{metric.lastError && !metric.refreshStatus && (
  <Badge variant="destructive" ...>Error</Badge>
)}

Question: Does the dashboard.getDashboardCharts query used on the member page include these fields? A quick check of the data shape would confirm this works as expected.

3. Test Coverage (Low Priority)

No tests exist for this component. While not blocking, consider adding basic tests for:

  • Rendering role + metric card pair
  • Handling the loading state when metric exists but chart doesn't
  • Read-only mode behavior

🎯 Code Quality Assessment

Category Rating Notes
Code Quality ✅ Excellent Clean, focused changes
Best Practices ✅ Good Follows React patterns, proper component reuse
Performance ✅ Good No performance concerns introduced
Security ✅ N/A No security implications
Type Safety ✅ Excellent Proper TypeScript usage throughout
Maintainability ✅ Excellent Simpler component interface, less props

📋 Minor Suggestions

  1. Component Import Organization (Nitpick):
    The import path is quite long:

    import { ReadOnlyMetricCard } from "@/app/dashboard/[teamId]/_components/dashboard-metric-card";

    Consider re-exporting from a barrel file or using a shorter alias if this component is used in multiple places.

  2. Loading State Message (Nitpick):
    "KPI data loading..." might be slightly confusing since the actual issue is the chart hasn't been configured yet (not that data is loading). Consider:

    <span className="text-sm">Chart configuration pending...</span>
    // or
    <span className="text-sm">Setting up chart...</span>

✨ Overall Assessment

Recommendation: Approve with minor suggestions

This is a solid, focused PR that improves the user experience on the member page. The changes are clean, follow existing patterns, and don't introduce any significant issues. The height consistency concern is worth double-checking, but it's not a blocker.

The removal of the unused teamId prop and the hover animation fix for read-only mode show good attention to detail. Nice work!


🚀 Next Steps (Optional)

After merge, consider:

  1. Verifying the actual rendered heights match expectations across different chart types
  2. Adding basic test coverage for the member page components
  3. Potentially extracting commonly used card dimensions to a shared constant

LGTM 🎉

@drifter089 drifter089 merged commit 5106c3d into main Jan 9, 2026
4 of 5 checks passed
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @src/app/member/[id]/_components/role-kpi-pair.tsx:
- Line 50: The placeholder div uses a hardcoded Tailwind height class h-[420px];
replace this with a CSS variable so the metric card height is shared with
ReadOnlyMetricCard/DashboardMetricChart: define --metric-card-height: 420px in
your global CSS or theme config (e.g., :root or globals.css) and change the JSX
className to use h-[var(--metric-card-height)] (and update the same replacement
inside ReadOnlyMetricCard / DashboardMetricChart) so both components read the
single source of truth for height.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b381b7 and f153df9.

📒 Files selected for processing (3)
  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/app/member/[id]/_components/team-section.tsx
  • src/components/role/role-card.tsx
💤 Files with no reviewable changes (1)
  • src/app/member/[id]/_components/team-section.tsx
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Use TypeScript 5.9 with strict type checking for all frontend and backend code

Files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
src/**/*.tsx

📄 CodeRabbit inference engine (GEMINI.md)

Prefer Server Components for initial data fetching; use Client Components ('use client') only for interactivity

Files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
src/**/*/*.tsx

📄 CodeRabbit inference engine (GEMINI.md)

Client Components must use import { api } from '@/trpc/react' for standard HTTP/Hooks wrapper

Files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
**/*.tsx

📄 CodeRabbit inference engine (GEMINI.md)

Use Tailwind CSS 4 for styling with shadcn/ui and Radix UI primitive components

Files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
src/app/**/*.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

src/app/**/*.tsx: Use the dual tRPC API pattern: direct calls in Server Components (api.team.getById) for 10x faster performance, and React hooks in Client Components (api.team.getById.useQuery)
Use getUserDisplayName(userId, members) utility (client-side sync) from @/lib/helpers/get-user-name for displaying user names in components

Files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use @trivago/prettier-plugin-sort-imports with inline type imports for import organization

Files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
src/components/**/*.tsx

📄 CodeRabbit inference engine (GEMINI.md)

Place colocated components in _components/ folders next to their parent component

Use shadcn/ui components from src/components/ui/; add new components via CLI: npx shadcn@latest add [component-name]

Files:

  • src/components/role/role-card.tsx
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/components/dashboard-metric-card.tsx,src/app/dashboard/[teamId]/_components/public-dashboard-metric-card.tsx : Dashboard metric cards are duplicated with public variant. Consolidate into single component with `readOnly` mode prop instead of maintaining separate components.
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/app/teams/[teamId]/_components/role-node.tsx,src/app/teams/[teamId]/_components/public-role-node.tsx : These role node components are 75% identical and should be consolidated. Extract shared `RoleNodeTemplate` component with `isEditable` prop to DRY up the code.
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:27:04.176Z
Learning: Applies to src/app/teams/[teamId]/_components/**/*.tsx : Implement cache-first node pattern for role nodes: store only roleId in node data, fetch display data from TanStack Query cache using useRoleData hook
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-20T22:12:00.576Z
Learning: Applies to src/app/teams/[teamId]/**/*.tsx : React Flow nodes must store minimal data (e.g., just `roleId`); fetch full Role data from TanStack Query cache in the Node component to keep canvas and sidebars in sync
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:27:04.176Z
Learning: Applies to src/hooks/**/*.ts : For role-metric cache updates, optimistically update both role cache (role.getByTeamId) and dashboard cache (dashboard.getDashboardCharts) to maintain UI consistency
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/app/dashboard/[teamId]/**/*.{ts,tsx} : Dashboard cache updates for role-metric assignments must update both `role.getByTeamId` and `dashboard.getDashboardCharts` caches during mutations. Use onMutate for optimistic updates on both caches, then invalidate both on success.
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/app/teams/[teamId]/**/*.{ts,tsx} : Cache-first node system: Role nodes store only `roleId` in node.data. Display data must be fetched from TanStack Query cache using the `useRoleData()` hook which queries the `role.getByTeamId` procedure.
📚 Learning: 2025-12-29T12:52:42.935Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/components/dashboard-metric-card.tsx,src/app/dashboard/[teamId]/_components/public-dashboard-metric-card.tsx : Dashboard metric cards are duplicated with public variant. Consolidate into single component with `readOnly` mode prop instead of maintaining separate components.

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
📚 Learning: 2025-12-29T12:52:42.935Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/app/teams/[teamId]/_components/role-node.tsx,src/app/teams/[teamId]/_components/public-role-node.tsx : These role node components are 75% identical and should be consolidated. Extract shared `RoleNodeTemplate` component with `isEditable` prop to DRY up the code.

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
📚 Learning: 2025-12-20T22:12:00.576Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-20T22:12:00.576Z
Learning: Applies to src/app/teams/[teamId]/**/*.tsx : React Flow nodes must store minimal data (e.g., just `roleId`); fetch full Role data from TanStack Query cache in the Node component to keep canvas and sidebars in sync

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
📚 Learning: 2025-12-29T21:27:04.176Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:27:04.176Z
Learning: Applies to src/hooks/**/*.ts : For role-metric cache updates, optimistically update both role cache (role.getByTeamId) and dashboard cache (dashboard.getDashboardCharts) to maintain UI consistency

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
📚 Learning: 2025-12-29T12:52:42.935Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/app/dashboard/[teamId]/**/*.{ts,tsx} : Dashboard cache updates for role-metric assignments must update both `role.getByTeamId` and `dashboard.getDashboardCharts` caches during mutations. Use onMutate for optimistic updates on both caches, then invalidate both on success.

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
📚 Learning: 2025-12-29T21:27:04.176Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:27:04.176Z
Learning: Applies to src/app/teams/[teamId]/_components/**/*.tsx : Implement cache-first node pattern for role nodes: store only roleId in node data, fetch display data from TanStack Query cache using useRoleData hook

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
📚 Learning: 2025-12-29T12:52:42.935Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/app/teams/[teamId]/**/*.{ts,tsx} : Cache-first node system: Role nodes store only `roleId` in node.data. Display data must be fetched from TanStack Query cache using the `useRoleData()` hook which queries the `role.getByTeamId` procedure.

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
📚 Learning: 2025-12-20T22:12:00.576Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-20T22:12:00.576Z
Learning: Applies to src/app/teams/[teamId]/**/*.tsx : Avoid modifying `enrichNodesWithRoleData` flow without understanding the complete canvas serialization logic for saving/loading React Flow nodes to the database

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
  • src/components/role/role-card.tsx
📚 Learning: 2025-12-29T21:27:04.176Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:27:04.176Z
Learning: Applies to src/app/(metric|dashboard)/**/*.tsx : Use three-stage metrics transformation: API → DataPoints (DataIngestionTransformer), DataPoints → ChartConfig (ChartTransformer), ChartConfig → UI (DashboardMetricChart)

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
📚 Learning: 2025-12-29T21:27:04.176Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:27:04.176Z
Learning: Applies to src/app/(teams|org)/**/*.tsx : Use shared MembersList component at src/components/member/member-list.tsx for displaying members in canvas sidebar and org page; it includes getMemberDisplayInfo() utility for initials/name logic

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
📚 Learning: 2025-12-29T21:27:04.176Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:27:04.176Z
Learning: Applies to src/app/metric/_components/**/*.tsx : Use shared MetricDialogBase component from base/ for all metric dialog implementations

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
📚 Learning: 2025-12-29T21:27:04.176Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T21:27:04.176Z
Learning: Applies to src/app/metric/_components/**/*.tsx : Create metric dialogs with pattern: [Provider]MetricDialog.tsx (dialog wrapper) + [Provider]MetricContent.tsx (form content) in src/app/metric/_components/[provider]/, then register in index.ts

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
📚 Learning: 2025-12-29T12:52:42.935Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/app/metric/_components/**/*.tsx : Metric dialog components should follow the pattern: [Provider]MetricDialog.tsx (dialog wrapper) and [Provider]MetricContent.tsx (form content). Register in src/app/metric/_components/index.ts and inherit from shared MetricDialogBase.

Applied to files:

  • src/app/member/[id]/_components/role-kpi-pair.tsx
📚 Learning: 2025-12-29T12:52:42.935Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/hooks/use-optimistic-role-update.ts : The `use-optimistic-role-update` hook provides shared logic for all role mutations with proper cache layer handling for TanStack Query and Prisma Accelerate. Use this hook in canvas-specific wrappers to add markDirty side effects.

Applied to files:

  • src/components/role/role-card.tsx
📚 Learning: 2025-12-29T12:52:42.935Z
Learnt from: CR
Repo: drifter089/orgOS PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-29T12:52:42.935Z
Learning: Applies to src/app/**/*role*mutation*.{ts,tsx} : For role mutations, use cache pipeline with two operations: (1) onMutate for optimistic update, (2) onSuccess with both setData(updatedRole) using server response AND invalidate() for background refresh. Always use server response data in setData before invalidate to ensure Prisma Accelerate cache consistency.

Applied to files:

  • src/components/role/role-card.tsx
🧬 Code graph analysis (1)
src/app/member/[id]/_components/role-kpi-pair.tsx (2)
src/components/role/role-card.tsx (1)
  • RoleCard (330-330)
src/app/dashboard/[teamId]/_components/dashboard-metric-card.tsx (1)
  • ReadOnlyMetricCard (125-162)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: claude-review
🔇 Additional comments (4)
src/app/member/[id]/_components/role-kpi-pair.tsx (3)

11-14: Clean prop interface simplification.

Removing the unused teamId prop from RoleKpiPair simplifies the component API and correctly reflects that ReadOnlyMetricCard doesn't require team context for rendering.

Also applies to: 16-16


39-39: LGTM! Minor spacing adjustment.

The grid gap change from gap-3 to gap-4 provides slightly more breathing room between the role card and KPI card.


3-3: Type compatibility verified — consolidation pattern is correct.

The replacement of KpiCard with ReadOnlyMetricCard correctly implements the dashboard metric card consolidation. Both DashboardChart (defined in role-kpi-pair.tsx) and DashboardChartWithRelations (expected by ReadOnlyMetricCard) are the same type: RouterOutputs["dashboard"]["getDashboardCharts"][number]. The component signature matches perfectly—ReadOnlyMetricCard requires only dashboardChart, eliminating the need for the teamId prop. This aligns with the consolidation pattern: a single component with read-only rendering instead of maintaining separate variants.

src/components/role/role-card.tsx (1)

184-185: LGTM! Appropriate conditional hover styling.

The conditional hover:shadow-lg correctly removes hover animations when cards are in display-only (readOnly) mode, improving the UX by signaling that these cards are not interactive. The selected state and other styling remain independent and functional.


{hasMetricButNoChart && (
<div className="border-border/60 text-muted-foreground flex items-center justify-center rounded-lg border border-dashed p-6">
<div className="border-border/60 text-muted-foreground flex h-[420px] items-center justify-center rounded-xl border border-dashed p-6">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, find the location of ReadOnlyMetricCard and related components
fd -t f 'dashboard-metric' src/ | head -20
fd -t f 'role-kpi-pair' src/

Repository: drifter089/orgOS

Length of output: 374


🏁 Script executed:

# Search for ReadOnlyMetricCard definition
rg -l 'ReadOnlyMetricCard' src/

Repository: drifter089/orgOS

Length of output: 366


🏁 Script executed:

# Get more context about the file under review
cat -n src/app/member/\[id\]/_components/role-kpi-pair.tsx | head -60

Repository: drifter089/orgOS

Length of output: 2158


🏁 Script executed:

# Read the dashboard-metric-card.tsx file
cat -n src/app/dashboard/\[teamId\]/_components/dashboard-metric-card.tsx

Repository: drifter089/orgOS

Length of output: 6447


🏁 Script executed:

# Also check the DashboardMetricChart component since it's likely used by ReadOnlyMetricCard
cat -n src/app/dashboard/\[teamId\]/_components/dashboard-metric-chart.tsx

Repository: drifter089/orgOS

Length of output: 18496


Use a shared CSS variable for the metric card height instead of hardcoding h-[420px] in two places.

Both the placeholder in this file and ReadOnlyMetricCard (via DashboardMetricChart) currently use h-[420px], so heights match. However, this magic number is duplicated across the codebase. Extracting it to a CSS variable in your globals or theme config ensures future changes to the metric card height automatically propagate everywhere, preventing layout shifts during maintenance.

🤖 Prompt for AI Agents
In @src/app/member/[id]/_components/role-kpi-pair.tsx at line 50, The
placeholder div uses a hardcoded Tailwind height class h-[420px]; replace this
with a CSS variable so the metric card height is shared with
ReadOnlyMetricCard/DashboardMetricChart: define --metric-card-height: 420px in
your global CSS or theme config (e.g., :root or globals.css) and change the JSX
className to use h-[var(--metric-card-height)] (and update the same replacement
inside ReadOnlyMetricCard / DashboardMetricChart) so both components read the
single source of truth for height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants